<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<meta name="viewport" content="width=1200, user-scalable=yes">
		<meta name="renderer" content="webkit"> <!-- for 360 -->
		<meta name="keywords" content="大湾区跨境电商暨新渠道博览会,跨博会,佛山跨境电商展,跨境电商展览会,跨境电商服务平台,进出口商品贸易展,跨境电商,选品大会,跨境选品会,跨境电商展,大湾区跨境电商交易博览会">
		<meta name="description" content="2021年大湾区跨境电商暨新渠道博览会将涵盖全跨境电商包括上游平台、代运营、供应链、下游商品等一站式服务体系展示。提供跨境生态全产业链,为跨境电商行业企业提供国内产品出海方案,旨在整合国内跨境电商行业资源,助力中国品牌走向世界,推动跨境电商整个行业健康有序的发展与进步">
		<meta name="applicable-device" content="pc">

		<title>大湾区跨境电商-观众登记</title>

		<link rel="shortcut icon" href="http://www.trade-show.cn/static/favicon.ico" />
		<link rel="stylesheet" type="text/css" href="./common/layui/css/layui.css" />
		<link rel="stylesheet" type="text/css" href="./css/gzdj.css" />
		
		<script src="js/cTopJs.js" type="text/javascript" charset="utf-8"></script>

		<script src="common/layui/layui.js"></script>
	</head>
	<body>
		<div class="container" id="app">
			<script src="./js/header.js" type="text/javascript" charset="utf-8"></script>
			<script src="./js/navbar.js" type="text/javascript" charset="utf-8"></script>

			<div class="mian w1200" id="gzdj">
				<form class="layui-form">
					<div class="title-text mb30">
						<div class="text t-t">ENTER/展商登记</div>
						<div class="text t-b mt10">Exhibitors registration</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label must">姓名 *</label>
						<div class="layui-input-block">
							<input type="text" name="uname" lay-verify="uname" placeholder="请输入姓名" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label must">身份证号码/护照 *</label>
						<div class="flex">
							<div class="layui-input-select" style="width: 150px;">
								<select name="idcard" lay-filter="idcard" id="select">
									<option value="1">居民身份证</option>
									<option value="2">护照</option>
								</select>
							</div>
							<div class="layui-input-select" style="width: 470px;">
								<input type="text" name="idnumber" lay-verify="idnumber" placeholder="请输入证件号码" class="layui-input">
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label must">公司名称 *</label>
						<div class="layui-input-block">
							<input type="text" name="cname" lay-verify="cname" placeholder="请输入公司名称" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label must">公司地址 *</label>
						<div class="layui-input-block">
							<input type="text" name="caddress" lay-verify="caddress" placeholder="请输入公司地址" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label must">手机 *</label>
						<div class="layui-input-block">
							<input type="text" name="mobile" lay-verify="mobile" placeholder="请输入手机" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label must">电子邮箱 *</label>
						<div class="layui-input-block">
							<input type="text" name="e_mail" lay-verify="e_mail" placeholder="请输入电子邮箱" class="layui-input">
						</div>
					</div>


					<div class="layui-form-btn">
						<button type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="demo1">提交</button>
						<button type="reset" class="layui-btn layui-btn-normal">重置</button>
					</div>

				</form>
			</div>
			<script src="./js/footer.js"></script>
		</div>

		<script type="text/javascript">
			layui.use(['form'], function() {
				let form = layui.form,
					layer = layui.layer;
				form.verify({
					uname: function(value) {
						value = $.trim(value);
						if (!value) {
							return '请输入姓名'
						}
					},
					idnumber: function(value) {
						value = $.trim(value);
						if (!value) {
							return '请输入证件号码'
						}
					},
					cname: function(value) {
						value = $.trim(value);
						if (!value) {
							return '请输入公司名称'
						}
					},
					caddress: function(value) {
						value = $.trim(value);
						if (!value) {
							return '请输入公司地址'
						}
					},
					mobile: function(value) {
						let reg = /^[1][3,4,5,7,8][0-9]{9}$/;
						if (!reg.test(value)) {
							return '手机格式不正确'
						}
					},
					e_mail: function(value) {
						let reg = /[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-zA-Z0-9]+/;
						if (!reg.test(value)) {
							return '邮箱格式不正确'
						}
					},
				});
				form.on('submit(demo1)', function(data) {
					let datas = data.field;
					console.log('要提交信息', data.field);
					let datalist = {
						"name": datas.uname,
						"type": datas.idcard,
						"number": datas.idnumber,
						"corporate_name": datas.cname,
						"address": datas.caddress,
						"mobile": datas.mobile,
						"email": datas.e_mail,
					}
					$.ajax({
						type: "POST",
						url: "http://admin.trade-show.cn/api/etradefair/v1/spectator/registration",
						contentType: "application/json",
						dataType: "json",
						data: JSON.stringify(datalist),
						success: function(response) {
							console.log('response', response);
							if (response.status == 1) {
								layer.msg("提交成功", {
									icon: 6
								});
							} else {
								layer.msg(response.msg, {
									icon: 5
								});
							}
						},
						error: function(err) {
							console.log(err);
						}
					});

					return false;
				})
			})
		</script>
	</body>
	<script src="js/cBottomJs.js" type="text/javascript" charset="utf-8"></script>
</html>
